package com.yangye.picommon.model.page;

import com.github.pagehelper.Page;
import lombok.Data;

import java.util.List;

/**
 * @author yangye
 * @date 2019/8/30
 */
@Data
public class PageResult<T> {

	private List<T> data;

	private Pagination pagination;

	public PageResult(Page<T> page) {
		this.data = page.getResult();
		this.pagination = new Pagination(page.getPageNum(), page.getPageSize(), page.getTotal(), page.getPages());
	}
}
